package luj.game.robot.internal.admin.message.internal.http;

import luj.game.robot.internal.admin.actor.BotAdminActor;
import luj.game.robot.internal.net.http.receive.BotHttpReceiver;
import luj.spring.anno.Internal;

@Internal
final class OnReceiveHttp implements BotAdminActor.Handler<ReceiveHttpMsg> {

  @Override
  public void onHandle(Context ctx) {
    BotAdminActor self = ctx.getActorState(this);
    ReceiveHttpMsg msg = ctx.getMessage(this);

    new BotHttpReceiver(msg.httpUri(), msg.httpParam(), msg.handleParam(),
        self.getHttpHandleMap(), self.getBossRef(), self.getBossDependency()).receive();
  }
}
